Release 10.1A: OpenEdge Development:
Programming Interfaces
4GL socket event model
The 4GL socket event model includes two types of 4GL events:
CONNECT— Posted on a server socket object when a client seeks to establish a socket connection. As part of generating this event, Progress creates a socket object for the server to communicate with the client on the new connection.READ-RESPONSE— Posted on a socket object when data is available to be read on the socket.Using events to connect and communicate
Like all 4GL events, these
CONNECTandREAD-RESPONSEevents are handled in the context of an I/O blocking orPROCESS EVENTSstatement. Figure 8–7 shows how two 4GL applications, one acting as a socket server and the other as a socket client, can use these events to communicate across a single connection.Figure 8–7: 4GL socket event model
![]()
The server creates and enables a server socket object for listening on a specified port. The client creates a socket object and attempts to connect that socket to the server port used by the server socket. The server accepts the connection request and runs a specified
CONNECTevent procedure in response to theCONNECTevent. This procedure receives a handle to a socket object that is implicitly created on the server for the connection. Once a connection is established, both the client and server can read and write data to each other using their connected socket objects.The socket object that the client creates and the socket object created on the server in response to the
CONNECTevent both reference the same TCP/IP connection. Using the 4GL event model, the client and server can each receive notifications of data from the other within aREAD-RESPONSEevent procedure that runs in response to aREAD-RESPONSEevent on the socket object. The client can specify this event procedure any time after it creates its socket object. The server can specify this event procedure any time after it receives the socket object in theCONNECTevent procedure.
|
Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |